package variabilitysmelldetection.measurement.measures.spl;

import java.util.Collection;
import java.util.HashSet;
import java.util.List;

import variabilitysmelldetection.measurement.measures.Measure;
import variabilitysmelldetection.measurement.models.ComponentItem;



public class NumberOfFeatures extends Measure {

	public NumberOfFeatures() {
		super("Number of Features", "NOF");
	}

	@Override
	public void measure(List<ComponentItem> items) {
		Collection<String> features = new HashSet<String>();
		for (ComponentItem item : items) {
			features.add(item.getParentName());
		}
		
		setValue(features.size());
	}
}